package com.tekj.cxqcb.view.Module.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.tekj.cxqcb.R;
import com.tekj.cxqcb.config.enums.EventBusMsgBean;
import com.tekj.cxqcb.operation.resultBean.ShopGoodsListBean;

import org.greenrobot.eventbus.EventBus;

import java.util.List;

import common.tool.Tools;

/**
 * 单个商品adapter
 */
public class NewStoreDetails2Adapter extends BaseQuickAdapter<ShopGoodsListBean.DataBean.TypeLevelList.ListBean, BaseViewHolder> {


    public NewStoreDetails2Adapter(@Nullable List<ShopGoodsListBean.DataBean.TypeLevelList.ListBean> data) {
        super(R.layout.item_rv_goods2, data);

    }

    @Override
    protected void convert(BaseViewHolder helper, ShopGoodsListBean.DataBean.TypeLevelList.ListBean item) {

        Tools.picassoNetwork(item.getServiceImg().replace(",", ""),
                (ImageView) helper.getView(R.id.img_photo));

        helper.setText(R.id.tv_goods_name, item.getServiceName());
        helper.setText(R.id.tv_price, item.getPrice() + "");
        helper.setText(R.id.tv_old_price, "￥" + item.getMarketPrice());
        Tools.setTextFlags((TextView) helper.getView(R.id.tv_old_price));

        helper.setText(R.id.tv_xl, "销量：" + "999");
        helper.setText(R.id.tv_kc, "库存：" + "999");
    }

}
